package com.dingup.paike.bean.utilbean;

import java.util.Date;

/**
 * Created by wancheng on 2018/12/3.
 */
public class DateNode {

    private String id;
    //时间节点
    private Date time;
    //是否开始时间
    private Boolean ifBegin = false;
    //是否有前一个DateIterator节点
    private Boolean hasPrevious = false;
    //是否有后一个DateIterator节点
    private Boolean hasNext = false;
    //前一个节点对象
    private DateNode previous;
    //后一个节点对象
    private DateNode next;

    public DateNode() {
    }

    public DateNode(Date time) {
        this.time = time;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public Boolean getIfBegin() {
        return ifBegin;
    }

    public void setIfBegin(Boolean ifBegin) {
        this.ifBegin = ifBegin;
    }

    public DateNode getNext() {
        return next;
    }

    public void setNext(DateNode next) {
        this.next = next;
    }

    public Boolean getHasPrevious() {
        return hasPrevious;
    }

    public void setHasPrevious(Boolean hasPrevious) {
        this.hasPrevious = hasPrevious;
    }

    public Boolean getHasNext() {
        return hasNext;
    }

    public void setHasNext(Boolean hasNext) {
        this.hasNext = hasNext;
    }

    public DateNode getPrevious() {
        return previous;
    }

    public void setPrevious(DateNode previous) {
        this.previous = previous;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        DateNode that = (DateNode) o;

        if (!time.equals(that.time)) return false;
        if (!ifBegin.equals(that.ifBegin)) return false;
        if (!hasPrevious.equals(that.hasPrevious)) return false;
        if (!hasNext.equals(that.hasNext)) return false;
        if (!previous.equals(that.previous)) return false;
        return next.equals(that.next);

    }

    @Override
    public int hashCode() {
        int result = time.hashCode();
        result = 31 * result + ifBegin.hashCode();
        result = 31 * result + hasPrevious.hashCode();
        result = 31 * result + hasNext.hashCode();
        result = 31 * result + previous.hashCode();
        result = 31 * result + next.hashCode();
        return result;
    }

}
